#ifndef _CNUMBOX_H_
#define _CNUMBOX_H_

#include <buola/widgets/ceditbox.h>

namespace buola { namespace gui {

class CNumBox : public CEditBox
{
public:
    CNumBox();
    virtual ~CNumBox();

    virtual void GetPropertyNames(std::vector<std::string> &pNames);
    virtual void SetProperty(const std::string &p,const UAny&);
    virtual void GetProperty(const std::string &p,UAny&);

protected:
////////////// Event handling //////////////
    virtual void OnKeyDown(const CKeyEvent &pE);
    virtual void OnStyleChanged(TStyle);

    virtual void OnExpose(const CExposeEvent &pE);

    virtual void OnButtonUp(const CMouseEvent &pE);
    virtual void OnButtonDown(const CMouseEvent &pE);
    virtual void OnMouseMove(const CMouseEvent &pE);
    virtual void OnMouseOut(const CMouseEvent &pE);
    virtual void OnFocusOut(const CFocusEvent &pE);
    virtual void OnEnter();

public:
////////////////// interface //////////////////////
    void SetValue(double);
    int64_t GetValue();
    double GetDoubleValue();
    void SetLimits(double,double);
    void SetStep(double);

    UEvent<void()> eNumChange;

protected:
    bool mInsideUp,mInsideDown;
    bool mPressedUp,mPressedDown;
    
    double mStep;
};

/*namespace gui*/ } /*namespace buola*/ }

#endif
